//勿改
var V1 = "┏━┳━━━━━━━━━┓";
var V2 = "┃花┃脚本仿制　定制脚本┃";
var V3 = "┃老┃技术支持　游戏顾问┃";
var V4 = "┃师┃ＷＺ添加　地图制作┃";
var V5 = "┣━┻━━━━━━━━━┫";
var V6 = "┃　唯一QQ:739977676   ┃";
var V7 = "┗━━━━━━━━━━━┛";
//
var 爱心 = "#fEffect/CharacterEff/1022223/4/0#";
var 礼包物品 = "#v1302000#";
var add = "#fEffect/CharacterEff/1112903/0/0#"; //红桃心
var aaa = "#fUI/UIWindow.img/Quest/icon9/0#"; //红色右箭头
var zzz = "#fUI/UIWindow.img/Quest/icon8/0#"; //蓝色右箭头
var sss = "#fUI/UIWindow.img/QuestIcon/3/0#"; //选择道具
var 正方箭头 = "#fUI/Basic/BtHide3/mouseOver/0#";
var 感叹号 = "#fUI/UIWindow/Quest/icon0#";
var 美化new = "#fUI/UIWindow/Quest/icon5/1#";
var 红色箭头 = "#fEffect/CharacterEff/1112908/0/1#"; //彩光3
var ttt1 = "#fEffect/CharacterEff/1062114/1/0#"; //爱心
var 蓝色角点 = "#fUI/UIWindow.img/PvP/Scroll/enabled/next2#";
var 正方箭头 = "#fUI/Basic/BtHide3/mouseOver/0#";
var 爱心 = "#fEffect/CharacterEff/1022223/4/0#";
var 粉爱心 = "#fItem/Etc/0427/04270005/Icon8/1#"; //
var 菊花 = "#fUI/PredictHarmony/card/19#"; //卡片效果菊花
var 笑 = "#fUI/GuildBBS/GuildBBS/Emoticon/Basic/0#"; //笑脸
var 金枫叶 = "#fMap/MapHelper/weather/maple/2#";
var 红枫叶 = "#fMap/MapHelper/weather/maple/1#";
var 巫女 = "#fMap/MapHelper/weather/witch/0#"; //巫女
var 气球 = "#fMap/MapHelper/weather/balloon/4#"; //气球
var 射箭 = "#fMap/MapHelper/weather/LoveEffect2/4/0#"; //射箭
var 玫瑰 = "#fMap/MapHelper/weather/rose/0#"; //玫瑰花
var 烟花 = "#fMap/MapHelper/weather/squib/squib1/3#"; //烟花

var 大粉红爱心 = "#fItem/Etc/0427/04270001/Icon8/4#"; //
var 小粉红爱心 = "#fItem/Etc/0427/04270001/Icon8/5#"; //
var 小黄星 = "#fItem/Etc/0427/04270001/Icon9/0#"; //
var 大黄星 = "#fItem/Etc/0427/04270001/Icon9/1#"; //
var 小水滴 = "#fItem/Etc/0427/04270001/Icon10/5#"; //
var 大水滴 = "#fItem/Etc/0427/04270001/Icon10/4#"; //
var tz = "#fEffect/CharacterEff/1082565/4/0#"; //粉兔子
var tz1 = "#fEffect/CharacterEff/1082565/0/0#"; //橙兔子
var tz2 = "#fEffect/CharacterEff/1082565/2/0#"; //蓝兔子
var 邪恶小兔 = "#fItem/Etc/0427/04270001/Icon10/5#"; //邪恶小兔 【小】
var 邪恶小兔2 = "#fEffect/CharacterEff/1112960/3/1#"; //邪恶小兔 【大】
var 花草 = "#fEffect/SetEff/208/effect/walk2/4#";
var 花草1 = "#fEffect/SetEff/208/effect/walk2/3#";
var 小花 = "#fMap/MapHelper/weather/birthday/2#";
var 桃花 = "#fMap/MapHelper/weather/rose/4#";
var 银杏叶 = "#fUI/GuildMark.img/Mark/Etc/00009003/15#";
var 小烟花 = "#fMap/MapHelper/weather/squib/squib4/1#";
var 星星 = "#fMap/MapHelper/weather/witch/3#";
var text = "";
var status = 0;
var 列表 = [
    //攻击 魔力
    [1, 1112562, 1, 2, 1, "乾坤"],
    [2, 1112561, 2, 4, 1, "破天"],
    [3, 1112560, 3, 6, 1, "狂舞"],
    [4, 1112559, 4, 8, 3, "天下"],
    [5, 1112558, 5, 10, 3, "证道"],
    [6, 1112557, 6, 12, 3, "玄冥"],
    [7, 1112556, 7, 14, 5, "无敌"],
    [8, 1112555, 8, 16, 5, "浮沉"],
    [9, 1112554, 9, 18, 5, "轮回"],
    [10, 1112553, 15, 30, 12, "不朽"],
    [11, 1112552, 16, 32, 12, "归一"],
    [12, 1112551, 17, 34, 12, "混乱"],
    [13, 1112550, 18, 36, 12, "万象"],
    [14, 1112549, 19, 38, 12, "苍穹"],
    [15, 1112548, 20, 40, 12, "轮回"],
    [16, 1112547, 22, 44, 18, "战神"],
    [17, 1112546, 24, 48, 18, "入魔"],
    [18, 1112545, 26, 52, 18, "化神"],
    [19, 1112544, 28, 56, 25, "修仙"],
    [20, 1112543, 30, 60, 25, "孤独"],
    [21, 1112542, 35, 70, 38, "神秘"]
];

var 部位 = [
    [- 101, "帽子"],
    [- 102, "脸饰"],
    [- 103, "眼饰"],
    [- 104, "耳环"],
    [- 109, "披风"],
    [- 105, "上衣"],
    [- 111, "武器"],
    [- 108, "手套"],
    [- 106, "裤子"],
    [- 107, "鞋子"]
];
var 数组 = [];

var 卡通图标花蘑菇 = "#fUI/GuildMark.img/Mark/Etc/00009003/15#"//
var 卡通图标绿水灵 = "#fUI/GuildMark.img/Mark/Etc/00009003/15#"//
var 卡通图标触须怪 = "#fUI/GuildMark.img/Mark/Etc/00009003/15#";//
var 卡通图标漂漂猪 = "#fUI/GuildMark.img/Mark/Etc/00009003/15#";//
var 卡通图标粉红熊 = "#fUI/GuildMark.img/Mark/Etc/00009003/15#";//
var 卡通图标泡泡鱼 = "#fUI/GuildMark.img/Mark/Etc/00009003/15##";//
var 卡通图标小蜘蛛 = "#fUI/GuildMark.img/Mark/Etc/00009003/15#";//
var 卡通图标黑色熊 = "#fUI/GuildMark.img/Mark/Etc/00009003/15#";//
function start() {
    status = -1;
    action(1, 0, 0);
}


function action(mode, type, selection) {
    if (mode == -1) {
        cm.dispose();
    } else {
        if (mode == 1) {
            status++;
        } else {
            status--;
        }
        //
        if (status == -1) {
            cm.dispose();
        } else if (status == 0) {
            text = "\r\n  #k┏"  + "━━━━━━━时装强化中心━━━━━━━"  + "┓#k\r\n";
            text += "  #L0#"  + "#e#r开始强化时装#k#n[建议把时装全部强化到同等级]#l\r\n";
           // text += "  #L1#" + 卡通图标漂漂猪 + "#e#r领取头衔戒指#k#n[达到强化等级免费领取，+总伤害]#l\r\n\r\n";
            text += "\r\n  #k┗"  + "━━━━━━━━━━━━━━━━━━━━"  + "┛#k";
            text += "\r\n需要：X";
            text += "\r\n#r·#kX:从强化7→8开始,如果有该卡,则会先使用该道具(+7以下还是需要消耗材料).\r\n";
            cm.sendSimple(text);
        } else if (status == 1) {
            if (selection == 0) {
                cm.dispose();
                cm.openNpc(9900004, "花老师_新_时装强化系统[追忆] - 副本");
                return;
            } else if (selection == 1) {
                text = "";
                text += "#r·#k需要时装:帽子/脸饰/眼饰/耳环/披风/手套/鞋子/武器/衣服/裤子.\r\n";
                text += "#r·#k强化到相应的级别,并且全部穿戴在身上,即可领取.\r\n";
                text += "\r\n#k┏" + 银杏叶 + "━━━━━━━━头衔戒指领取━━━━━━━━" + 银杏叶 + "┓#k\r\n";
                for (var i = 0; i < 列表.length; i++) {
                    text += "#L" + i + "#领〈#r+" + 列表[i][0] + "#k〉#b" + 列表[i][5] + "#k套  [攻击:" + 列表[i][2] + "] [魔力:" + 列表[i][3] + "] [总伤害+:" + 列表[i][4] + "%]#l\r\n";
                    数组.push(图标(列表[i][1]));
                }
                text += "\r\n#k┗" + 银杏叶 + "━━━━━━━━━━━━━━━━━━━━━━" + 银杏叶 + "┛#k";
                for (var i = 0; i < 数组.length; i++) {
                    text += "\r\n          #k" + 数组[i] + "";
                }
                //" + 图标(列表[i][1]) + "
                cm.sendSimple(text);
                序号 = 2;
            } else if (selection == 2) {
                cm.dispose();
            }
        } else if (status == 2) {
            if (序号 == 2) {
                选择 = selection;
                //
                if (cm.getInventory(1).isFull(0)) {
                    cm.sendOk("#r对不起,您的背包装备栏不足.请在背包第一格放入时装\r\n" + 提示);
                    cm.dispose();
                    return;
                }
                var 合格 = true;
                //判断是否合格
                for (var i = 0; i < 部位.length; i++) {
                    var 当前强化等级 = 0;
                    var 装备 = cm.getInventory(-1).getItem(部位[i][0]);
                    if (装备 == null) {
                        合格 = false;
                        break;
                    }
                    var 装备名片 = "" + cm.getInventory(-1).getItem(部位[i][0]).getOwner();
                    if (装备名片 != "") {
                        当前强化等级 = 装备名片.replace(/[^0-9]/ig, ""); //提取字符串裡面的数字
                    } else {
                        当前强化等级 = 0;
                    }
                    if (当前强化等级 < 列表[选择][0]) {
                        合格 = false;
                        break;
                    }
                }
                //
                if (合格 == false) {
                    cm.sendOk("#b领取失败!\r\n#k需要时装:帽子/脸饰/眼饰/耳环/披风/手套/鞋子/武器/衣服/裤子.穿戴在#r身上#k并且全部强化到#r+" + 列表[选择][0] + "#k或以上.\r\n");
                    cm.dispose();
                    return;
                }
                if (cm.getPlayer().getOneTimeLog("头衔戒指套装领取" + 列表[选择][1]) == 1) {
                    cm.sendOk("[你已经领取过该套装了.]");//中间蓝色框
                    cm.dispose();
                    return;
                }
                //判断材料
                if (列表[选择][1] != 1112562) {
                    if (cm.getPlayer().getItemQuantity(列表[选择 - 1][1], false) < 1) {
                        cm.sendOk("请把#v" + 列表[选择 - 1][1] + "##z" + 列表[选择 - 1][1] + "#放到背包里,如果没有请按顺序领取!\r\n");
                        cm.dispose();
                        return;
                    }
                    cm.gainItem(列表[选择 - 1][1], -1);
                }
                //
                cm.getPlayer().setOneTimeLog("头衔戒指套装领取" + 列表[选择][1]);
                cm.gainItem(列表[选择][1], 0, 0, 0, 0, 0, 0, 列表[选择][2], 列表[选择][3], 0, 0, 0, 0, 0, 0, 1, 0);
                //
                cm.sendOk("#r领取成功,请在背包查看#v" + 列表[选择][1] + "#,并且穿戴起来吧!\r\n");
                cm.dispose();
                return;
                //
                //
            }
            cm.dispose();
        }
        //


    }
}
function 图标(params) {
    var 星星 = "#fEffect/CharacterEff1.img/" + params + "/0/0#";
    return 星星;
}